#!/bin/sh

if [ -f ./Makefile ]; then
    make $@
elif [ -f ./go.mod ]; then
    if [ "$#" = "0" ]; then
        go build
    else
        go "$@"
    fi
elif [ -f ./build.gradle ]; then
    if [ "$#" = "0" ]; then
        gradle build
    else
        gradle "$@"
    fi
elif [ -f ./CMakeFront.cmake ]; then
    ./CMakeFront.cmake $@
elif [ -f ./CMakePresets.json ]; then
    if [ "$#" = "0" ]; then
        cmake --workflow --preset default
    else
        cmake --workflow --preset "$@"
    fi
elif [ -f ./build.py ]; then
    python3 ./build.py "$@"
else
    make "$@"
fi
